ABC110 D - Factorization